#ifndef BOARD_H
#define BOARD_H

#include <web_socket.h>
#include <string>
#include "led/led.h"
#include "boards/audio_codecs/audio_codec.h"

void* create_board();
class Board {
private:
    Board(const Board&) = delete; // 禁用拷贝构造函数
    Board& operator=(const Board&) = delete; // 禁用赋值操作

protected:
    Board();

public:
    static Board& GetInstance() {
        static Board* instance = nullptr;
        if (nullptr == instance) {
            instance = static_cast<Board*>(create_board());
        }
        return *instance;
    }

    // 虚函数部分
    virtual void StartNetwork() = 0;
    virtual ~Board() = default;
    virtual Led* GetLed();
    virtual WebSocket* CreateWebSocket(std::string url) = 0;
    virtual AudioCodec* GetAudioCodec() = 0;
    virtual bool GetNetworkState(std::string& network_name, int& signal_quality, std::string& signal_quality_text) = 0;
};


#define DECLARE_BOARD(BOARD_CLASS_NAME)\
void* create_board() {\
    return new BOARD_CLASS_NAME();\
}


#endif // BOARD_H
